﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Formular;
using Pixysoft.Weblications.Sango.Protocol.player;
using Pixysoft.Weblications.Sango.Protocol;

namespace Pixysoft.Weblications.Sango.Command.party
{
    partial class SangoPartyHandler
    {
        public party_logoupgradeinfo party_logoupgradeinfo()
        {
            string userCode = SangoManager.Authentication();

            party_logoupgradeinfo response = ReflectionManager.CreatePojo<party_logoupgradeinfo>();
            response.Succeed = false;

            Entities.Usr_Party party = PartyDao.tryGetPartyByUsercode(userCode);
            if (party == null)
            {
                response.Message = "未加入军团";
                return response;
            }

            if (party.Logolevel >= PartyFormular.default_maxlogolevel)
            {
                response.Message = "团徽到达最大等级";
                return response;
            }

            long goldvalue = PartyFormular.LogoLevelGoldValue(party.Logolevel + 1);
            response.gold = goldvalue;
            response.Succeed = true;
            return response;
        }
    }

    public interface party_logoupgradeinfo : ISangoResponse
    {
        long gold { get;set;}
    }
}
